<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>flex布局，盒子的高度以最高的设置全部</title>
    <style>
      html,
      body {
        margin: 0;
        padding: 0;
      }
      .modelList {
        width: 100vw;
        display: flex;
        flex-wrap: nowrap;
        gap: 20px;
        padding: 10px 20px 20px;
        border-bottom: 1px solid #f0f0f0;
        box-sizing: border-box;
        overflow: auto;
      }
      .modelItem {
        width: calc(calc(100% - (20px * 3)) / 4);
        cursor: pointer;
        border: 1px solid #e8e8e8;
        border-radius: 10px;
        padding: 24px;
        transition: all 0.3s ease-in-out;
        background-color: #fff;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
      }
      .modelItem:hover {
        box-shadow: 0 4px 12px #e3e3e3;
      }
    </style>
  </head>
  <body>
    <div class="modelList">
      <div class="modelItem">
        1
        <div class="main">main</div>
      </div>
      <div class="modelItem">
        2
        <div class="main">main1</div>
        <div class="main">main2</div>
        <div class="main">main3</div>
        <div class="main">main4</div>
      </div>
      <div class="modelItem">
        3
        <div class="main">main1</div>
        <div class="main">main2</div>
        <div class="main">main3</div>
      </div>
      <div class="modelItem">
        4
        <div class="main">main1</div>
        <div class="main">main2</div>
      </div>
    </div>
  </body>
</html>
